<template>

	<view>
		<uni-search-bar @confirm="search" :focus="true" v-model="searchValue" @blur="blur" @input="input"
			@clear="clear">
			<template v-slot:searchIcon>
				<uni-icons type="scan" size="25" @click="scan"></uni-icons>
			</template>

		</uni-search-bar>



	</view>
</template>

<script>
	import {
		listMaoTaInfo
	} from '@/utils/api.js'

	export default {
		onLoad(options) {
			//this.load()
		},
		data() {
			return {
				searchValue: '',
				listRequest: {
					page: 1,
					pageSize: 12,
					qrcode: ''
				},
				isloadList: true,
				listData: []
			}
		},
		methods: {
			scan() {
				uni.scanCode({
					success: (res) => {
						uni.showToast({
							title: '扫码成功',
							duration: 1500
						});
						uni.navigateTo({
							url: 'savemaotai?view=true&qrcode=' + res.result
						})
					},
					fail: (res) => {
						uni.showToast({
							title: '扫码失败',
							icon: 'error',
							duration: 1500
						});
					}
				})
			}
		},

		onPullDownRefresh() {
			// this.load()
			uni.stopPullDownRefresh()
		},
		onReachBottom() {
			this.listRequest.page++
			// this.load()
		}
	}
</script>

<style>

</style>